import tkinter as tk


window = tk.Tk()
window.title('my window')
window.geometry('200x200')

var = tk.StringVar()
l = tk.Label(window, bg='yellow', width=20,text='empty')
l.pack()


def print_selection(v):
    l.config(text='you have selected  '+v)

s=tk.Scale(window,label='try me',from_=5,to=11,orient=tk.HORIZONTAL,length=200,showvalue=1,tickinterval=3,resolution=0.01,command=print_selection)  #取值范围  方向 长度 标签单位长度 
#保留小数 
s.pack()

window.mainloop()
